﻿Imports DTO
Imports System.Data.SqlClient


Public Class ViTri_DAO
    Public Shared Function getViTriTheoMaKe(ByVal make As Integer) As DataTable
        Dim dt As New DataTable
        Dim con As SqlConnection = DataProvider.ConnectToDB

        Dim cmd As New SqlCommand
        cmd.CommandText = "ViTri_GetByMaKe"
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Connection = con

        Dim para As New SqlParameter("make", SqlDbType.Int)
        para.Direction = ParameterDirection.Input
        para.Value = make
        cmd.Parameters.Add(para)

        Dim adapter As New SqlDataAdapter(cmd)
        adapter.Fill(dt)

        con.Close()
        Return dt
    End Function

    Public Shared Function loadViTri() As DataTable
        Return DataProvider.loadDataTable("Select *from vitri")
    End Function

    Public Shared Function loadViTriTrong() As DataTable
        Return DataProvider.loadDataWithStore("ViTri_Trong")
    End Function

End Class
